+2001-12-04 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): remove
+ g_assert_not_reached() that was bogus, since we demand-create the
+ tag info. reported by Chris Phelps
+
+ Jump through assorted hoops to fix bug from Chris Phelps where
+ removing tags from the table resulted in btree trying to
+ access tag->table
+
+ * gtk/gtktextbuffer.c: set up mechanics of adding/removing
+ ourselves to the tag table
+
+ * gtk/gtktexttagtable.c (_gtk_text_tag_table_add_buffer)
+ (_gtk_text_tag_table_remove_buffer): private cruft to
+ let us notify buffer of disappearing tags
+
+ * gtk/gtktexttag.h: remove BTreeNode typedef from this public
+ header, put it in tagprivate
+
+ * gtk/gtktextbtree.c (_gtk_text_btree_new): don't connect to
+ tag_removed; it's emitted too late.
+ (_gtk_text_btree_notify_will_remove_tag): rename tag_remove_cb to
+ this
+
+ Padding for ABI-compat expansion
+
+ * gtk/gtktexttag.h (struct _GtkTextAttributes): pad this
+ (struct _GtkTextAppearance): one pad in here too
+
+ * gtk/gtktextlayout.h (struct _GtkTextLayoutClass): padding here
+
+ * gtk/gtktextview.h (struct _GtkTextViewClass): more padding,
+ since action signals etc. seem pretty likely
+
+ * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): padding
+
+ * gtk/gtktexttag.h (struct _GtkTextTagClass): padding
+
+ * gtk/gtktexttagtable.h (struct _GtkTextTagTableClass): padding
+
2001-12-04 Matthias Clasen <matthiasc@poet.de>
* gdk/gdkcolor.h (gdk_colormap_change): Deprecate. (#65851)
* gtk/gtktreeviewcolumn.h: ditto
2001-12-04 Havoc Pennington <hp@redhat.com>
-
+
* gtk/gtktexttag.c (gtk_text_tag_set_property): add a warning for
"invisible" property, #65999
+2001-12-04 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): remove
+ g_assert_not_reached() that was bogus, since we demand-create the
+ tag info. reported by Chris Phelps
+
+ Jump through assorted hoops to fix bug from Chris Phelps where
+ removing tags from the table resulted in btree trying to
+ access tag->table
+
+ * gtk/gtktextbuffer.c: set up mechanics of adding/removing
+ ourselves to the tag table
+
+ * gtk/gtktexttagtable.c (_gtk_text_tag_table_add_buffer)
+ (_gtk_text_tag_table_remove_buffer): private cruft to
+ let us notify buffer of disappearing tags
+
+ * gtk/gtktexttag.h: remove BTreeNode typedef from this public
+ header, put it in tagprivate
+
+ * gtk/gtktextbtree.c (_gtk_text_btree_new): don't connect to
+ tag_removed; it's emitted too late.
+ (_gtk_text_btree_notify_will_remove_tag): rename tag_remove_cb to
+ this
+
+ Padding for ABI-compat expansion
+
+ * gtk/gtktexttag.h (struct _GtkTextAttributes): pad this
+ (struct _GtkTextAppearance): one pad in here too
+
+ * gtk/gtktextlayout.h (struct _GtkTextLayoutClass): padding here
+
+ * gtk/gtktextview.h (struct _GtkTextViewClass): more padding,
+ since action signals etc. seem pretty likely
+
+ * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): padding
+
+ * gtk/gtktexttag.h (struct _GtkTextTagClass): padding
+
+ * gtk/gtktexttagtable.h (struct _GtkTextTagTableClass): padding
+
2001-12-04 Matthias Clasen <matthiasc@poet.de>
* gdk/gdkcolor.h (gdk_colormap_change): Deprecate. (#65851)
* gtk/gtktreeviewcolumn.h: ditto
2001-12-04 Havoc Pennington <hp@redhat.com>
-
+
* gtk/gtktexttag.c (gtk_text_tag_set_property): add a warning for
"invisible" property, #65999
+2001-12-04 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): remove
+ g_assert_not_reached() that was bogus, since we demand-create the
+ tag info. reported by Chris Phelps
+
+ Jump through assorted hoops to fix bug from Chris Phelps where
+ removing tags from the table resulted in btree trying to
+ access tag->table
+
+ * gtk/gtktextbuffer.c: set up mechanics of adding/removing
+ ourselves to the tag table
+
+ * gtk/gtktexttagtable.c (_gtk_text_tag_table_add_buffer)
+ (_gtk_text_tag_table_remove_buffer): private cruft to
+ let us notify buffer of disappearing tags
+
+ * gtk/gtktexttag.h: remove BTreeNode typedef from this public
+ header, put it in tagprivate
+
+ * gtk/gtktextbtree.c (_gtk_text_btree_new): don't connect to
+ tag_removed; it's emitted too late.
+ (_gtk_text_btree_notify_will_remove_tag): rename tag_remove_cb to
+ this
+
+ Padding for ABI-compat expansion
+
+ * gtk/gtktexttag.h (struct _GtkTextAttributes): pad this
+ (struct _GtkTextAppearance): one pad in here too
+
+ * gtk/gtktextlayout.h (struct _GtkTextLayoutClass): padding here
+
+ * gtk/gtktextview.h (struct _GtkTextViewClass): more padding,
+ since action signals etc. seem pretty likely
+
+ * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): padding
+
+ * gtk/gtktexttag.h (struct _GtkTextTagClass): padding
+
+ * gtk/gtktexttagtable.h (struct _GtkTextTagTableClass): padding
+
2001-12-04 Matthias Clasen <matthiasc@poet.de>
* gdk/gdkcolor.h (gdk_colormap_change): Deprecate. (#65851)
* gtk/gtktreeviewcolumn.h: ditto
2001-12-04 Havoc Pennington <hp@redhat.com>
-
+
* gtk/gtktexttag.c (gtk_text_tag_set_property): add a warning for
"invisible" property, #65999
+2001-12-04 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): remove
+ g_assert_not_reached() that was bogus, since we demand-create the
+ tag info. reported by Chris Phelps
+
+ Jump through assorted hoops to fix bug from Chris Phelps where
+ removing tags from the table resulted in btree trying to
+ access tag->table
+
+ * gtk/gtktextbuffer.c: set up mechanics of adding/removing
+ ourselves to the tag table
+
+ * gtk/gtktexttagtable.c (_gtk_text_tag_table_add_buffer)
+ (_gtk_text_tag_table_remove_buffer): private cruft to
+ let us notify buffer of disappearing tags
+
+ * gtk/gtktexttag.h: remove BTreeNode typedef from this public
+ header, put it in tagprivate
+
+ * gtk/gtktextbtree.c (_gtk_text_btree_new): don't connect to
+ tag_removed; it's emitted too late.
+ (_gtk_text_btree_notify_will_remove_tag): rename tag_remove_cb to
+ this
+
+ Padding for ABI-compat expansion
+
+ * gtk/gtktexttag.h (struct _GtkTextAttributes): pad this
+ (struct _GtkTextAppearance): one pad in here too
+
+ * gtk/gtktextlayout.h (struct _GtkTextLayoutClass): padding here
+
+ * gtk/gtktextview.h (struct _GtkTextViewClass): more padding,
+ since action signals etc. seem pretty likely
+
+ * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): padding
+
+ * gtk/gtktexttag.h (struct _GtkTextTagClass): padding
+
+ * gtk/gtktexttagtable.h (struct _GtkTextTagTableClass): padding
+
2001-12-04 Matthias Clasen <matthiasc@poet.de>
* gdk/gdkcolor.h (gdk_colormap_change): Deprecate. (#65851)
* gtk/gtktreeviewcolumn.h: ditto
2001-12-04 Havoc Pennington <hp@redhat.com>
-
+
* gtk/gtktexttag.c (gtk_text_tag_set_property): add a warning for
"invisible" property, #65999
+2001-12-04 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): remove
+ g_assert_not_reached() that was bogus, since we demand-create the
+ tag info. reported by Chris Phelps
+
+ Jump through assorted hoops to fix bug from Chris Phelps where
+ removing tags from the table resulted in btree trying to
+ access tag->table
+
+ * gtk/gtktextbuffer.c: set up mechanics of adding/removing
+ ourselves to the tag table
+
+ * gtk/gtktexttagtable.c (_gtk_text_tag_table_add_buffer)
+ (_gtk_text_tag_table_remove_buffer): private cruft to
+ let us notify buffer of disappearing tags
+
+ * gtk/gtktexttag.h: remove BTreeNode typedef from this public
+ header, put it in tagprivate
+
+ * gtk/gtktextbtree.c (_gtk_text_btree_new): don't connect to
+ tag_removed; it's emitted too late.
+ (_gtk_text_btree_notify_will_remove_tag): rename tag_remove_cb to
+ this
+
+ Padding for ABI-compat expansion
+
+ * gtk/gtktexttag.h (struct _GtkTextAttributes): pad this
+ (struct _GtkTextAppearance): one pad in here too
+
+ * gtk/gtktextlayout.h (struct _GtkTextLayoutClass): padding here
+
+ * gtk/gtktextview.h (struct _GtkTextViewClass): more padding,
+ since action signals etc. seem pretty likely
+
+ * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): padding
+
+ * gtk/gtktexttag.h (struct _GtkTextTagClass): padding
+
+ * gtk/gtktexttagtable.h (struct _GtkTextTagTableClass): padding
+
2001-12-04 Matthias Clasen <matthiasc@poet.de>
* gdk/gdkcolor.h (gdk_colormap_change): Deprecate. (#65851)
* gtk/gtktreeviewcolumn.h: ditto
2001-12-04 Havoc Pennington <hp@redhat.com>
-
+
* gtk/gtktexttag.c (gtk_text_tag_set_property): add a warning for
"invisible" property, #65999
+2001-12-04 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): remove
+ g_assert_not_reached() that was bogus, since we demand-create the
+ tag info. reported by Chris Phelps
+
+ Jump through assorted hoops to fix bug from Chris Phelps where
+ removing tags from the table resulted in btree trying to
+ access tag->table
+
+ * gtk/gtktextbuffer.c: set up mechanics of adding/removing
+ ourselves to the tag table
+
+ * gtk/gtktexttagtable.c (_gtk_text_tag_table_add_buffer)
+ (_gtk_text_tag_table_remove_buffer): private cruft to
+ let us notify buffer of disappearing tags
+
+ * gtk/gtktexttag.h: remove BTreeNode typedef from this public
+ header, put it in tagprivate
+
+ * gtk/gtktextbtree.c (_gtk_text_btree_new): don't connect to
+ tag_removed; it's emitted too late.
+ (_gtk_text_btree_notify_will_remove_tag): rename tag_remove_cb to
+ this
+
+ Padding for ABI-compat expansion
+
+ * gtk/gtktexttag.h (struct _GtkTextAttributes): pad this
+ (struct _GtkTextAppearance): one pad in here too
+
+ * gtk/gtktextlayout.h (struct _GtkTextLayoutClass): padding here
+
+ * gtk/gtktextview.h (struct _GtkTextViewClass): more padding,
+ since action signals etc. seem pretty likely
+
+ * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): padding
+
+ * gtk/gtktexttag.h (struct _GtkTextTagClass): padding
+
+ * gtk/gtktexttagtable.h (struct _GtkTextTagTableClass): padding
+
2001-12-04 Matthias Clasen <matthiasc@poet.de>
* gdk/gdkcolor.h (gdk_colormap_change): Deprecate. (#65851)
* gtk/gtktreeviewcolumn.h: ditto
2001-12-04 Havoc Pennington <hp@redhat.com>
-
+
* gtk/gtktexttag.c (gtk_text_tag_set_property): add a warning for
"invisible" property, #65999
+2001-12-04 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): remove
+ g_assert_not_reached() that was bogus, since we demand-create the
+ tag info. reported by Chris Phelps
+
+ Jump through assorted hoops to fix bug from Chris Phelps where
+ removing tags from the table resulted in btree trying to
+ access tag->table
+
+ * gtk/gtktextbuffer.c: set up mechanics of adding/removing
+ ourselves to the tag table
+
+ * gtk/gtktexttagtable.c (_gtk_text_tag_table_add_buffer)
+ (_gtk_text_tag_table_remove_buffer): private cruft to
+ let us notify buffer of disappearing tags
+
+ * gtk/gtktexttag.h: remove BTreeNode typedef from this public
+ header, put it in tagprivate
+
+ * gtk/gtktextbtree.c (_gtk_text_btree_new): don't connect to
+ tag_removed; it's emitted too late.
+ (_gtk_text_btree_notify_will_remove_tag): rename tag_remove_cb to
+ this
+
+ Padding for ABI-compat expansion
+
+ * gtk/gtktexttag.h (struct _GtkTextAttributes): pad this
+ (struct _GtkTextAppearance): one pad in here too
+
+ * gtk/gtktextlayout.h (struct _GtkTextLayoutClass): padding here
+
+ * gtk/gtktextview.h (struct _GtkTextViewClass): more padding,
+ since action signals etc. seem pretty likely
+
+ * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): padding
+
+ * gtk/gtktexttag.h (struct _GtkTextTagClass): padding
+
+ * gtk/gtktexttagtable.h (struct _GtkTextTagTableClass): padding
+
2001-12-04 Matthias Clasen <matthiasc@poet.de>
* gdk/gdkcolor.h (gdk_colormap_change): Deprecate. (#65851)
* gtk/gtktreeviewcolumn.h: ditto
2001-12-04 Havoc Pennington <hp@redhat.com>
-
+
* gtk/gtktexttag.c (gtk_text_tag_set_property): add a warning for
"invisible" property, #65999
BTreeView *views;
GSList *tag_infos;
guint tag_changed_handler;
- guint tag_removed_handler;
+
/* Incremented when a segment with a byte size > 0
* is added to or removed from the tree (i.e. the
* length of a line may have changed, and lines may
GtkTextTag *tag,
gboolean size_changed,
GtkTextBTree *tree);
-static void tag_removed_cb (GtkTextTagTable *table,
- GtkTextTag *tag,
- GtkTextBTree *tree);
static void cleanup_line (GtkTextLine *line);
static void recompute_node_counts (GtkTextBTree *tree,
GtkTextBTreeNode *node);
G_CALLBACK (tag_changed_cb),
tree);
- tree->tag_removed_handler = g_signal_connect (G_OBJECT (tree->table),
- "tag_removed",
- G_CALLBACK (tag_removed_cb),
- tree);
-
tree->mark_table = g_hash_table_new (g_str_hash, g_str_equal);
tree->child_anchor_table = NULL;
g_signal_handler_disconnect (G_OBJECT (tree->table),
tree->tag_changed_handler);
- g_signal_handler_disconnect (G_OBJECT (tree->table),
- tree->tag_removed_handler);
-
g_object_unref (G_OBJECT (tree->table));
g_free (tree);
}
}
-static void
-tag_removed_cb (GtkTextTagTable *table,
- GtkTextTag *tag,
- GtkTextBTree *tree)
+void
+_gtk_text_btree_notify_will_remove_tag (GtkTextBTree *tree,
+ GtkTextTag *tag)
{
/* Remove the tag from the tree */
list = g_slist_next (list);
}
-
- g_assert_not_reached ();
- return;
}
static void
void _gtk_text_btree_release_mark_segment (GtkTextBTree *tree,
GtkTextLineSegment *segment);
+/* for coordination with the tag table */
+void _gtk_text_btree_notify_will_remove_tag (GtkTextBTree *tree,
+ GtkTextTag *tag);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
text_buffer->tag_table = table;
g_object_ref (G_OBJECT (text_buffer->tag_table));
+
+ _gtk_text_tag_table_add_buffer (table, text_buffer);
}
return text_buffer;
if (buffer->tag_table)
{
+ _gtk_text_tag_table_remove_buffer (buffer->tag_table, buffer);
g_object_unref (G_OBJECT (buffer->tag_table));
buffer->tag_table = NULL;
}
get_table (GtkTextBuffer *buffer)
{
if (buffer->tag_table == NULL)
- buffer->tag_table = gtk_text_tag_table_new ();
+ {
+ buffer->tag_table = gtk_text_tag_table_new ();
+ _gtk_text_tag_table_add_buffer (buffer->tag_table, buffer);
+ }
return buffer->tag_table;
}
{
if (buffer->btree == NULL)
buffer->btree = _gtk_text_btree_new (gtk_text_buffer_get_tag_table (buffer),
- buffer);
+ buffer);
return buffer->btree;
}
return cache->entries[0].attrs;
}
+void
+_gtk_text_buffer_notify_will_remove_tag (GtkTextBuffer *buffer,
+ GtkTextTag *tag)
+{
+ /* This removes tag from the buffer, but DOESN'T emit the
+ * remove_tag signal, because we can't afford to have user
+ * code messing things up at this point; the tag MUST be removed
+ * entirely.
+ */
+ if (buffer->btree)
+ _gtk_text_btree_notify_will_remove_tag (buffer->btree, tag);
+}
+
/*
* Debug spew
*/
{
_gtk_text_btree_spew (get_btree (buffer));
}
-
-
-
-
-
/* Called at the start and end of an atomic user action */
void (* begin_user_action) (GtkTextBuffer *buffer);
void (* end_user_action) (GtkTextBuffer *buffer);
+
+ GtkFunction pad1;
+ GtkFunction pad2;
+ GtkFunction pad3;
+ GtkFunction pad4;
+ GtkFunction pad5;
+ GtkFunction pad6;
};
GType gtk_text_buffer_get_type (void) G_GNUC_CONST;
const GtkTextIter *anywhere_in_line,
gint *char_len);
+void _gtk_text_buffer_notify_will_remove_tag (GtkTextBuffer *buffer,
+ GtkTextTag *tag);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
GtkWidget *child,
gint x,
gint y);
+
+ GtkFunction pad1;
+ GtkFunction pad2;
};
struct _GtkTextAttrAppearance
#endif /* __cplusplus */
typedef struct _GtkTextIter GtkTextIter;
-typedef struct _GtkTextBTreeNode GtkTextBTreeNode;
typedef struct _GtkTextTagTable GtkTextTagTable;
typedef struct _GtkTextAttributes GtkTextAttributes;
*/
GtkTextAttributes *values;
-
+
/* Flags for whether a given value is set; if a value is unset, then
* this tag does not affect it.
*/
GObject *event_object, /* widget, canvas item, whatever */
GdkEvent *event, /* the event itself */
const GtkTextIter *iter); /* location of event in buffer */
+
+ GtkFunction pad1;
+ GtkFunction pad2;
};
GType gtk_text_tag_get_type (void) G_GNUC_CONST;
/* super/subscript rise, can be negative */
gint rise;
+
+ /* I'm not sure this can really be used without breaking some things
+ * an app might do :-/
+ */
+ gpointer padding1;
guint underline : 4; /* PangoUnderline */
guint strikethrough : 1;
*/
guint inside_selection : 1;
guint is_text : 1;
+
+ guint pad1 : 1;
+ guint pad2 : 1;
+ guint pad3 : 1;
+ guint pad4 : 1;
};
struct _GtkTextAttributes
PangoLanguage *language;
+ /* I'm not sure this can really be used without breaking some things
+ * an app might do :-/
+ */
+ gpointer padding1;
+
/* hide the text */
guint invisible : 1;
#include <gtk/gtktexttag.h>
+typedef struct _GtkTextBTreeNode GtkTextBTreeNode;
+
/* values should already have desired defaults; this function will override
* the defaults with settings in the given tags, which should be sorted in
* ascending order of priority
#include "gtktexttagtable.h"
#include "gtkmarshalers.h"
#include "gtksignal.h"
+#include "gtktextbuffer.h" /* just for the lame notify_will_remove_tag hack */
#include <stdlib.h>
g_hash_table_destroy (table->hash);
g_slist_free (table->anonymous);
+ g_slist_free (table->buffers);
+
(* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
gtk_text_tag_table_remove (GtkTextTagTable *table,
GtkTextTag *tag)
{
+ GSList *tmp;
+
g_return_if_fail (GTK_IS_TEXT_TAG_TABLE (table));
g_return_if_fail (GTK_IS_TEXT_TAG (tag));
g_return_if_fail (tag->table == table);
+ /* Our little bad hack to be sure buffers don't still have the tag
+ * applied to text in the buffer
+ */
+ tmp = table->buffers;
+ while (tmp != NULL)
+ {
+ _gtk_text_buffer_notify_will_remove_tag (GTK_TEXT_BUFFER (tmp->data),
+ tag);
+
+ tmp = tmp->next;
+ }
+
/* Set ourselves to the highest priority; this means
when we're removed, there won't be any gaps in the
priorities of the tags in the table. */
return g_hash_table_size (table->hash) + table->anon_count;
}
+
+void
+_gtk_text_tag_table_add_buffer (GtkTextTagTable *table,
+ gpointer buffer)
+{
+ g_return_if_fail (GTK_IS_TEXT_TAG_TABLE (table));
+
+ table->buffers = g_slist_prepend (table->buffers, buffer);
+}
+
+void
+_gtk_text_tag_table_remove_buffer (GtkTextTagTable *table,
+ gpointer buffer)
+{
+ g_return_if_fail (GTK_IS_TEXT_TAG_TABLE (table));
+
+ table->buffers = g_slist_remove (table->buffers, buffer);
+}
GHashTable *hash;
GSList *anonymous;
gint anon_count;
+
+ GSList *buffers;
};
struct _GtkTextTagTableClass {
void (* tag_changed) (GtkTextTagTable *table, GtkTextTag *tag, gboolean size_changed);
void (* tag_added) (GtkTextTagTable *table, GtkTextTag *tag);
void (* tag_removed) (GtkTextTagTable *table, GtkTextTag *tag);
+
+ GtkFunction pad1;
+ GtkFunction pad2;
};
GType gtk_text_tag_table_get_type (void) G_GNUC_CONST;
gint gtk_text_tag_table_get_size (GtkTextTagTable *table);
+/* INTERNAL private stuff - not even exported from the library on
+ * many platforms
+ */
+void _gtk_text_tag_table_add_buffer (GtkTextTagTable *table,
+ gpointer buffer);
+void _gtk_text_tag_table_remove_buffer (GtkTextTagTable *table,
+ gpointer buffer);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
GtkFunction pad2;
GtkFunction pad3;
GtkFunction pad4;
+
+ GtkFunction pad5;
+ GtkFunction pad6;
+ GtkFunction pad7;
+ GtkFunction pad8;
};
GtkType gtk_text_view_get_type (void) G_GNUC_CONST;